package br.ucb.cm.board.util;

import br.ucb.cm.board.bean.Location;

public class MirroringUtil {
	public static Location getMirroredLocation(int width, int height, Location location){
		int y = location.getY();

		Location newLocation = new Location(location.getX(), (height - y) - 1);

		if (newLocation.equals(location))
			return null;

		return newLocation;
	}

	public static Location getInvertedLocation(int width, int height, Location location){
		int x = location.getX();
		int y = location.getY();

		Location newLocation = new Location((width - x) - 1, (height - y) - 1);

		if (newLocation.equals(location))
			return null;

		return newLocation;	
	}
}
